// pages/myStar/myStar.js
var util=require('../../utils/util')
Page({
  data: {
    openid:"",
    star:[]
  },
  onLoad()
  {
    var that=this
    that.setData({
      openid:wx.getStorageSync('openid')
    })
    wx.cloud.database().collection("userList").where({openid:this.data.openid}).get({
      success(res){
        console.log(res.data[0].star)
        that.setData({
          star:res.data[0].star
        })
      }
    })
    // var time=util.formatTime2(new Date())
    // var dateTime=time;
    // console.log(dateTime)
  },
  toPage(e){
    console.log(e.currentTarget.dataset.index)
    wx.navigateTo({
      url: '../comContext/comContext?id='+e.currentTarget.dataset.id+'&star=1'+'&index='+e.currentTarget.dataset.index
    })
  }
})